﻿using System;
using System.Collections.Generic;
using System.Linq;
using ExpenseSystem.Common;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;

namespace ExpenseSystem.Fether
{
    public class ServiceOrderDetailFetcher : NormalFetcher<ServiceOrderDetailModel>, IDetailFetcher<ServiceOrderDetailModel>
    {

        public IList<ServiceOrderDetailModel> ListByMainId( long site, long mainId, out string message, out int rows)
        {
            IList<ServiceOrderDetailModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out  rows, Restrain.Eq("ServiceId", mainId).And(Restrain.Eq("Avaliable", true)));
            return result;
        }

        public IList<ServiceOrderDetailModel> ListByDeliveryDetail( long site, long customService, out string message, out int rows)
        {
            IList<ServiceOrderDetailModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out  rows, Restrain.Eq("DeliveryDetailId", customService).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
    }
}
